Skip to content

Count NotFoundException#829

Merged
abnegate merged 1 commit intomainfrom
count-collection-not-found
Mar 9, 2026
Merged

Count NotFoundException#829
abnegate merged 1 commit intomainfrom
count-collection-not-found

Conversation

@fogelito
Copy link
Contributor

@fogelito fogelito commented Mar 8, 2026

Summary by CodeRabbit

  • Bug Fixes
    • Collection operations now return clear error messages when a collection cannot be found instead of failing silently, improving debugging and application stability.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 8, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: b007ab27-4af5-4635-a899-b02013f15017

📥 Commits

Reviewing files that changed from the base of the PR and between 91c9965 and ac63954.

📒 Files selected for processing (1)
  • src/Database/Database.php

📝 Walkthrough

Walkthrough

The pull request adds defensive null-check validation to the count and sum operations in the Database class. When a collection cannot be resolved, both methods now explicitly throw a NotFoundException with "Collection not found" message instead of proceeding silently.

Changes

Cohort / File(s) Summary
Database Collection Validation
src/Database/Database.php
Added NotFoundException checks in count() and sum() methods to verify collection existence before proceeding, aligning error handling behavior across the class.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐰 A rabbit hops with cautious care,
Checking collections everywhere—
No silent fails shall slip on through,
With thrown exceptions, errors ring true!
Defensive code makes logic bright. ✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'Count NotFoundException' is partially related to the changeset. It references the exception type being added but omits the key detail that this applies to both count AND sum operations, not just count.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch count-collection-not-found

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@abnegate abnegate merged commit 438cc82 into main Mar 9, 2026
18 checks passed
@abnegate abnegate deleted the count-collection-not-found branch March 9, 2026 04:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants